home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / doom / doom_16t.3 / doom_16t / sndcvt / sdoom < prev    next >
Text File  |  1995-01-16  |  1KB  |  73 lines

  1. #!/bin/sh
  2. #
  3. # DOOM startup script        Charles (int@link.xs4all.nl)
  4. #
  5.  
  6.    doomdir=~/.doom
  7.    doomsndserver=/usr/games/bin/sndserver
  8.    DOOMWADDIR=/usr/games/lib/doom
  9.  
  10.    prgname=`basename $0`
  11.    args=$*
  12.    newargs=""
  13.  
  14.  
  15.    create_doom_dir()
  16.    {
  17.       if type getkeys &> /dev/null
  18.       then
  19.       echo -n "$prgname: $doomdir does not exist!  create it? "; ch=`getkeys yn`
  20.       echo ""
  21.       if [ "$ch" = "n" ]; then exit 1; fi
  22.       fi
  23.  
  24.       mkdir $doomdir || (echo "$prgname: failed to create $doomdir"; exit 1)
  25.       echo "$prgname: created $doomdir"
  26.    }
  27.  
  28.    #
  29.    # expand filenames after -file to the full pathname
  30.    #
  31.    process_cmdline()
  32.    {
  33.       while [ "$1" != "" ];
  34.       do
  35.     newargs="$newargs $1"
  36.     if [ "$1" = "-file" ] || [ "$1" = "-playdemo" ]
  37.     then
  38.         while [ "$1" != "" ];
  39.         do
  40.         shift
  41.           case $1 in
  42.            -*)
  43.               break;;
  44.            "")
  45.               return;;
  46.            /*)
  47.               newargs="$newargs $1"
  48.               ;;
  49.             *)
  50.               newargs="$newargs `pwd`/$1"
  51.               ;;
  52.           esac
  53.         done
  54.     else
  55.         shift
  56.     fi
  57.       done
  58.    }
  59.  
  60.    if [ ! -x $doomdir ]; then create_doom_dir; fi
  61.  
  62.    process_cmdline $args
  63.  
  64.    cd $doomdir || (echo "$prgname: can't cd to $doomdir"; exit 1)
  65.  
  66.    ln -sf $doomsndserver .
  67.  
  68.  
  69.    sndcvt -s &
  70.  
  71.    exec linuxsdoom $newargs #< /dev/null
  72.  
  73.